# # 获取播报次数,初始为0
# n = 0                           # 循环变量
# # 判断播报次数是否小于5次
# while n < 5:                    # 循环判断
#     # 是:进行播报
#     print(f"扫码{n}")            # 循环体
#     # 播报次数+=1
#     n += 1                      # 循环变量发生变化
#
# # 下班
# print("下班")

# # 循环变量
# n = 0
# sum1 = 0
# # 循环判断
# while n <= 100:
#     # 循环体
#     sum1 = sum1 + n
#     # 循环变量发生变化
#     n += 1
#
# print(sum1)

# # 偶数累加和
# # 循环变量
# n = 0
# sum1 = 0
# # 循环判断
# while n <= 100:
#     # 循环体
#     sum1 = sum1 + n
#     # 循环变量发生变化
#     n += 2
#
# print(sum1)


# # 偶数累加和
# # 循环变量
# n = 0
# sum1 = 0
# # 循环判断
# while n <= 100:
#     # =========================
#     # 循环体:判断n是否能被2整除,如果能添加到sum1里面
#     if n % 2 == 0:
#         sum1 = sum1 + n
#     # ==========================
#     # 循环变量发生变化
#     n += 1
#
# print(sum1)

# # break:终止整个循环,不在继续
# # 循环变量
# n = 1
# # 循环判断
# while n <= 10:
#     # 循环体
#     if n >3:
#         print("没有拭子了")
#         break
#     print(f"做了第{n}个核酸")
#     # 循环变量发生变化
#     n += 1
#
#
# # continue:中止当前一次循环,继续下一次循环,
# # continue在while循环内需要在前面加上循环变量发生变化,否则会死循环
# # 循环变量
# n = 1
# # 循环判断
# while n <= 10:
#     # 循环体
#     if n == 3:
#         print(f"第{n}个坏了")
#         n += 1
#         continue
#     print(f"做了第{n}个核酸")
#     # 循环变量发生变化
#     n += 1


# # 循环变量
# guan = 1
# # 循环判断
# while guan <= 3:
#     # ====================================
#     # 循环体
#     print(f"做了第{guan}个管的核酸")
#     # 循环变量
#     n = 1
#     # 循环判断
#     while n <= 10:
#         # 循环体
#         print(f"做了第{n}个核酸")
#         # 循环变量发生变化
#         n += 1
#     # ====================================
#     # 循环变量发生变化
#     guan += 1


"""
*****
*****
*****
*****
*****
"""

# # 循环变量
# line = 1
# # 循环判断
# while line<=5:
#     # 循环体
#     # ====================================
#     # 循环变量
#     n = 1
#     # 循环判断
#     while n <= 5:
#         # 循环体
#         print("*", end="")
#         # 循环变量发生变化
#         n += 1
#     print()
#     # ====================================
#     # 循环变量发生变化
#     line+=1


# # 循环搭配else使用
# # 循环变量
# day = 1
# # 循环判断
# while day <= 3:
#     # 循环体
#     print(f"第{day}天的核酸结果是阴性")
#     # 循环变量发生变化
#     day += 1
#
# else:
#     print("嗨嗨皮皮去上班")
# # 循环搭配else使用
# # 循环变量
# day = 1
# # 循环判断
# while day <= 3:
#     # 循环体
#     if day == 2:
#         print(f"第{day}天没出结果")
#         day += 1
#         continue
#     print(f"第{day}天的核酸结果是阴性")
#     # 循环变量发生变化
#     day += 1
#
# else:
#     print("嗨嗨皮皮去上班")

# # 循环搭配else使用
# # 循环变量
# day = 1
# # 循环判断
# while day <=3:
#     # 循环体
#     if day == 2:
#         print(f"阳了个阳了")
#         break
#     print(f"第{day}天的核酸结果是阴性")
#     # 循环变量发生变化
#     day+=1
# # 循环被break则不在触发循环后面的else了,正常结束和continue过会触发else内的代码
# else:
#     print("嗨嗨皮皮去上班")


# for循环学习
str1 = "hello"
for i in str1:
    print(i)
else:
    print("正常结束")

str1 = "hello"
for i in str1:
    if i == "l":
        print("这个不打印")
        break
    print(i)

else:
    print("正常结束")

str1 = "hello"
for i in str1:
    if i =="l":
        print("这个不打印")
        continue
    print(i)
else:
    print("正常结束")



# 循环变量
res = True
# 循环判断
while res:
    # 循环体
    print("123")
    user = input("是否继续:")
    # 循环变量发生变化
    if user=="否":
        res = False